package com.gateio.flutter.lib_furnace.container

import android.content.pm.ActivityInfo
import android.os.Build
import android.os.Bundle

class GTFlutterDialogActivity : GTFlutterFragmentActivity() {

    companion object {
        fun withCachedEngineId(cachedEngineId: String) = GTCachedEngineIntentBuilder(GTFlutterDialogActivity::class.java, cachedEngineId)
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        val dialogEnableLandscape = intent.getBooleanExtra("dialogEnableLandscape", false)
        if (dialogEnableLandscape) {
            requestedOrientation = if (Build.VERSION.SDK_INT == Build.VERSION_CODES.O) {
                ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
            } else {
                ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
            }
        }
        super.onCreate(savedInstanceState)
    }

}